import request from '@/utils/request'


//查询分类列表
export function listCategory(query) {
  return request({
    url: '/system/category/categoryList',
    method: 'get',
    params: query
  })
}
//搜索分类列表
export function searchCategory(query){
  return request({
    url: '/system/category/search',
    method: 'get',
    params: query
  })
}

//新增分类
export function addCategory(data) {
  return request({
    url: '/system/category/save',
    method: 'post',
    params: data
  })
}
//修改分类
export function updateCategory(data){
  return request({
    url: '/system/category/updateCategory',
    method: 'post',
    params: data
  })
}

//删除分类
export function removeCategory(data){
  return request({
    url: '/system/category/removeCategory',
    method: 'put',
    params: data
  })
}

//查询分类详情
export function getCategory(id){
  return request({
    url: '/system/category/getCategory/' + id,
    method: 'get'
  })
}

// 查询菜单列表
export function listMenu(query) {
  return request({
    url: '/system/menu/list',
    method: 'get',
    params: query
  })
}


// 查询菜单下拉树结构
export function treeselect() {
  return request({
    url: '/system/menu/treeselect',
    method: 'get'
  })
}

// 根据角色ID查询菜单下拉树结构
export function roleMenuTreeselect(roleId) {
  return request({
    url: '/system/menu/roleMenuTreeselect/' + roleId,
    method: 'get'
  })
}
